#pragma once
#include<event2/event.h>
#include<list>
#include<mutex>
#include"Xtask.h"
class XThread
{
public:
	void start();
	void main();
	bool setup();
	void addtask(Xtask *task);
	int id = 0;
	void notify(evutil_socket_t fd, short what);
	void Active();
private:
	int notify_send_fd = 0;
	event_base* base = 0;
	std::list<Xtask*> tasks;
	std::mutex tasks_mutex;

};

